<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('category', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',60);//分类名称
            $table->string('short_title',16);//分类简称
            $table->string('identify',16);//标识
            $table->integer('pid');//父级id
            $table->boolean('is_virtual')->default(true);//是否允许虚拟商品
            $table->boolean('is_show')->default(true);//是否显示
            $table->boolean('available')->default(true);//是否启用
            $table->string('keywords',60)->nullable();//关键词
            $table->text('description')->nullable();//描述
            $table->integer('sort')->default(99);//排序
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('category');
    }
}
